#ifndef _CDATE_T_H_
#define _CDATE_T_H_
#include <time.h>
#include <iostream>
#include <iosfwd>
#include <iomanip>

using namespace std;


class cDate_t{
	friend ostream& operator<<(ostream& os, const cDate_t& time);

protected:
	int _day;
	int _month;
	int _year;
	int _printFormat;

	void fillStruct_tm(struct tm &t) const;
	static void fillStruct_tm(struct tm &tm_Temp, const int& day,const int& month,const int& year);

public:
	cDate_t();
	cDate_t(const int& day,const int& month,const int& year);
	cDate_t(const cDate_t &mycDate_t);
	cDate_t &operator=(const cDate_t &other);
	bool setPrintFormat(const int &format);
	int getPrintFormat() const;
	void setCurrentDate();
	bool setDate(const int& day,const int& month,const int& year);
	int getDay()const;
	int getMonth()const;
	int getYear()const;
	const char* getDayName() const;
	const char* getMonthName() const;
	bool isYearLeap() const;
	int getDayOfYear() const;
	static bool legalDate(const int& day,const int& month,const int& year);
	

	static char* dayofweek[];
	static char* monthNames[];


};

#endif //_CDATE_T_H_